package com.yulian.web.handler.impl; 

import com.yulian.web.handler.CommonHandler;
import com.yulian.web_api.common.CommonManager;
import com.yulian.web_api.system_management.AuthorizationManager;

import io.netty.util.internal.logging.InternalLogger;
import io.netty.util.internal.logging.Log4JLoggerFactory;
import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;
import io.vertx.ext.web.RoutingContext;
import io.vertx.pgclient.PgPool;

/**
 * 此类为接口CommonHandler的实现类，在该类的handle方法中，对多个页面共用的 web请求uri，调用业务逻辑类的相应方法进行处理 
 * @author    余大勇
 */
public class CommonHandlerImpl implements CommonHandler {

	//final InternalLogger logger = Log4JLoggerFactory.getInstance(SupplierInfoHandlerImpl.class);
	private final PgPool pool;
	private final JsonObject config; 
	public CommonHandlerImpl(PgPool pool, JsonObject config){ 
		this.pool = pool;
		this.config = config; 
	}
	@Override
	public void handle(RoutingContext req) {  
		JsonObject bodyJSObj = req.body().asJsonObject(); 
		CommonManager commonManager = new CommonManager();
		AuthorizationManager authorization = new AuthorizationManager(); 
		JsonObject responseJSObj = new JsonObject();
		switch(req.request().uri().toString()) { 
		case "/web/common/get_auth":
        	//获取当前用户在***页面所具有的按钮权限
        	authorization.getAuth(pool, bodyJSObj, req.user())
            .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
            .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
            break;
		case "/web/common/get_aes_key":
        	//获取当前用户在***页面所具有的按钮权限
        	commonManager.getAesKey(pool, bodyJSObj)
        	.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
        	.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
            break;
		case "/web/common/post_aes_endata":
        	//获取当前用户在***页面所具有的按钮权限
        	commonManager.postEnData(pool, bodyJSObj)
        	.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))	
        	.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
            break;
		case "/web/common/get_goods_gather_area":  
			commonManager.getGoodsGatherArea(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
			break;
		case "/web/common/get_class_lv1":  
			commonManager.getClassLv1(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
			break;
		case "/web/common/get_class_lv1_of_class_lv2":  
			commonManager.getClassLv1OfClassLv2(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
			break;	
		case "/web/common/get_class_lv2":  
			commonManager.getClassLv2(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
			break;
		case "/web/common/get_class_lv2_of_variety":  
			commonManager.getClassLv2OfVariety(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
			break;
		case "/web/common/get_variety":  
			commonManager.getVariety(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_variety_of_aggregation":  
			commonManager.getVarietyOfAggregation(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_aggregation":  
			commonManager.getAggregation(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;
		case "/web/common/get_aggregation_of_supply_chain_goods":  
			commonManager.getAggregationOfSupplyChainGoods(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_supply_chain_goods_from_goods_pool":  
			commonManager.getSupplyChainGoodsFromGoodsPool(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_supply_chain_goods":  
			commonManager.getSupplyChainGoods(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;
		case "/web/common/get_supply_chain_goods_grade":  
			commonManager.getSupplyChainGoodsGrade(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;
		case "/web/common/get_list_goods_from_goods_pool":  
			commonManager.getListGoodsFromGoodsPool(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;
		case "/web/common/get_list_goods":  
			commonManager.getListGoods(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_list_goods_grade":  
			commonManager.getListGoodsGrade(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;
		case "/web/common/get_sales_package_spec_type":  
			commonManager.getSalesPackageSpecType(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_goods_price_mode":  
			commonManager.getGoodsPriceMode(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;
		case "/web/common/get_goods_specification":  
			commonManager.getGoodsSpecification(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;
		case "/web/common/get_sales_quantity_scheme":  
			commonManager.getSalesQuantityScheme(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_supplier":  
			commonManager.getSupplier(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;	
		case "/web/common/get_supplier_grade":  
			commonManager.getSupplierGrade(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;	
		case "/web/common/get_supply_chain_partner":  
			commonManager.getSupplierChainPartner(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_gender": 
			JsonArray jsonArray = config.getJsonArray("GENDER_INFO_LIST"); 
			responseJSObj.put("data", jsonArray);
            req.response().putHeader("content-type", "application/json").end(responseJSObj.toString()); 
			break;
		case "/web/common/get_age_group":  
			commonManager.getAgeGroup(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_operation_period":  
			commonManager.getOperationPeriod(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_account_type":  
			commonManager.getAccountType(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_invoice_type":  
			commonManager.getInvoiceType(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_invoice_cycle":  
			commonManager.getInvoiceCycle(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;
		case "/web/common/get_goods_sales_grade":  
			commonManager.getGoodsSalesGrade(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;
		case "/web/common/get_material_price_mode":  
			commonManager.getMaterialPriceMode(pool)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;
//		case "/web/common/get_supplier_type":
//			commonManager.getSupplierType(pool, config)
//			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
//			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
//			break;
		case "/web/common/get_role":  
			commonManager.getRole(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;	
//		case "/web/common/get_system_menu":
//			commonManager.getSystemMenu(pool)
//			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
//			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
//			break;
//		case "/web/common/get_system_parent_menu":
//			commonManager.getSystemParentMenu(pool)
//			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
//			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
//			break;
		case "/web/common/get_site":  
			commonManager.getSite(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_site_query":  
			commonManager.getSiteQuery(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		//开始处理查询筛选下拉框	
		case "/web/common/get_goods_gather_area_query":   
			commonManager.getGoodsGatherAreaQuery(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;	
		 case "/web/common/get_mainline_route":
             commonManager.getMainlineRoute(pool)
             .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
             .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
             break;
		case "/web/common/get_mainline_route_query":
            commonManager.getMainlineRouteQuery(pool, bodyJSObj)
            .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
            .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
            break;
		case "/web/common/get_class_lv1_query":  
			commonManager.getClassLv1Query(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;	
		case "/web/common/get_class_lv2_query":  
			commonManager.getClassLv2Query(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;
		case "/web/common/get_variety_query":  
			commonManager.getVarietyQuery(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;	
		case "/web/common/get_aggregation_query":  
			commonManager.getAggregationQuery(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;		
		case "/web/common/get_supplier_query":  
			commonManager.getSupplierQuery(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;
		case "/web/common/get_goods_sales_grade_query":  
			commonManager.getGoodsSalesGradeQuery(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_supplier_type_query":  
			commonManager.getSupplierTypeQuery(pool, config, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_list_goods_status_query":  
			commonManager.getListGoodsStatusQuery(pool, config, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;
		case "/web/common/get_supply_chain_goods_status_query":  
			commonManager.getSupplyChainGoodsStatusQuery(pool, config, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_admit_query":  
			commonManager.getAdmitQuery(pool, config, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;
		case "/web/common/get_delete_query":  
			commonManager.getDeleteQuery(pool, config, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;
		case "/web/common/get_outer_package_type":  
			commonManager.getOuterPackageType(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;
		case "/web/common/get_outer_package_type_query":  
			commonManager.getOuterPackageTypeQuery(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_outer_package_mode":  
			commonManager.getOuterPackageMode(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_outer_package_mode_query":  
			commonManager.getOuterPackageModeQuery(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_inner_package_type":  
			commonManager.getInnerPackageType(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;
		case "/web/common/get_inner_package_type_query":  
			commonManager.getInnerPackageTypeQuery(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_package_charac_type":  
			commonManager.getPackageCharacType(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_package_charac_type_query":  
			commonManager.getPackageCharacTypeQuery(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_truck_type":  
			commonManager.getTruckType(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;
		case "/web/common/get_truck_type_query":  
			commonManager.getTruckTypeQuery(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;
		case "/web/common/get_residence_area":  
			commonManager.getResidenceArea(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;
		case "/web/common/get_residence_area_query":  
			commonManager.getResidenceAreaQuery(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));  
			break;
		case "/web/common/get_carrier_driver_query":  
			commonManager.getCarrierDriverQuery(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;
		case "/web/common/get_legal_entity_query":  
			commonManager.getLegalEntityQuery(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break; 
		case "/web/common/get_loss_type_query":  
			commonManager.getLossTypeQuery(pool, bodyJSObj)
			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString())); 
			break;  
		}  
	} 

}
